package goodimpl

import "strconv"

type Phone struct {
	Name     string
	Quantity int
	Price    int
}

// SettleAccount 计算总价
func (phone Phone) SettleAccount() int {
	return phone.Quantity * phone.Price
}

// OrderInfo 商品信息
func (phone Phone) OrderInfo() string {
	return "您要购买" + strconv.Itoa(phone.Quantity) + "个" + phone.Name + "计：" + strconv.Itoa(phone.SettleAccount()) + "元"
}
